#!/usr/bin/python3
from math import sqrt


def prime_number(numbers):
    if numbers < 2:
        return False
    for i in range(2, int(sqrt(numbers))+1):
        if 0 == numbers % i:
            return False

    return True


def find2prime_mult(number):
    for j in range(2, number):
        if number % j == 0:
            s = number / j
            if prime_number(s) and prime_number(j):
                return True

    return False


try:
    t = int(input())
    for x in range(t):
        n = int(input())
        if prime_number(n):
            print("NO")
        else:
            if find2prime_mult(n):
                print("YES")
            else:
                print("NO")

except ValueError:
    pass
except EOFError:
    pass
except MemoryError:
    pass
